export function getMinutesDiff(time: string | Date): number {
  // 如果传入的不是Date对象，则尝试解析为Date对象
  const targetTime: Date = typeof time === 'string' ? new Date(time) : time;

  // 获取当前时间
  const currentTime: Date = new Date();

  // 计算时间差（毫秒）
  const diffInMilliseconds: number =
    currentTime.getTime() - targetTime.getTime();

  // 将毫秒转换为分钟并四舍五入
  const diffInMinutes: number = Math.round(diffInMilliseconds / (1000 * 60));

  return diffInMinutes;
}
